  /****** Object:  Stored Procedure USERGetList    Script Date: Monday, June 12, 2006 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[spUSERGetUnReservedCustomerList]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [spUSERGetUnReservedCustomerList]
GO

	
	

CREATE PROCEDURE spUSERGetUnReservedCustomerList

AS


SELECT
	[USER].[US_ID_PK],
	[NAME],
	[LOGIN_NAME],
	[PASSWORD],
	[EMAIL],
	[USER_TYPE],
	CountryID,
	[CUSTOMER_CODE],
	[BAR_CODE],
	[IS_ADMIN],
	[IS_ENABLED],
	[CREATED_DATE],
	[CREATED_BY],
	[UPDATED_DATE],
	[UPDATED_BY],
	[CHANGE_PWD_GUID],
	[SORT_REFERENCE1],
	[SORT_REFERENCE2],
	[DOWNLOADABLE_CSV],
	[ActiveOfficeID]
FROM
	 [USER]
WHERE [USER_TYPE]=3
AND US_ID_PK NOT IN (SELECT UserID FROM CustomerProducts)
ORDER BY [LOGIN_NAME]

GO

	
